package com.surge;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SurgeMain {

	private static ApplicationContext ctx;

	public static void main(String[] args) {
		
		
		// 创建 Spring 的 IOC 容器
		ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
		
		/*
		 * 1、bean 的继承
		 */
		Address address =  (Address) ctx.getBean("address");
		
		System.out.println(address);

		
		/*
		 * 2、bean 的依赖
		 */
		Person person =  (Person) ctx.getBean("person");
		
		System.out.println(person);
		
		
	}

}
